<?php
/* @var $this ProductAdminController */
/* @var $data DndBoxanhfoodProduct */
?>

<div class="view">
    <?php 
        $data->scenario = 'admin';
    ?>
	<b><?php echo CHtml::encode($data->getAttributeLabel('name')); ?>:</b>
	<?php echo CHtml::link(CHtml::encode($data->name),array('view', 'id'=>$data->id)); ?>
	<br />
	<b><?php echo CHtml::encode($data->getAttributeLabel('code')); ?>:</b>
	<?php echo CHtml::encode($data->code); ?>
	<br />
	
	<b><?php echo CHtml::encode($data->getAttributeLabel('description')); ?>:</b>
	<?php echo CHtml::encode($data->description); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('alias')); ?>:</b>
	<?php echo CHtml::encode($data->alias); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('in_stock')); ?>:</b>
	<?php echo CHtml::encode($data->in_stock); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('on_sale')); ?>:</b>
	<?php echo CHtml::encode(number_format($data->on_sale,0)); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('on_sale_start')); ?>:</b>
	<?php echo CHtml::encode($data->on_sale_start); ?>
	<br />
    <b><?php echo CHtml::encode($data->getAttributeLabel('on_sale_end')); ?>:</b>
	<?php echo CHtml::encode($data->on_sale_end); ?>
	<br />
    <b><?php echo CHtml::encode($data->getAttributeLabel('status')); ?>:</b>
	<?php echo CHtml::encode(($data->status ? 'Đang bán': 'Ngưng bán')); ?>
	<br />
    <b><?php echo CHtml::encode($data->getAttributeLabel('category_id')); ?>:</b>
    <?php $category = Category::model()->findAll("id='".$data->category_id."'"); 
	?>
	<?php echo CHtml::encode($category[0]->name); ?>
	<br />
    <b><?php echo CHtml::encode($data->getAttributeLabel('image')); ?>:</b>
    <img src="<?php echo UrlHelper::productImage($data->image); ?>" width="200px" height="200px" style="padding: 5px;border-radius: 20px;background-color: #C3CCEB;"/>
	<br />
    
	<?php /*
	<b><?php echo CHtml::encode($data->getAttributeLabel('on_sale_end')); ?>:</b>
	<?php echo CHtml::encode($data->on_sale_end); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('creation_datetime')); ?>:</b>
	<?php echo CHtml::encode($data->creation_datetime); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('last_update')); ?>:</b>
	<?php echo CHtml::encode($data->last_update); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('status')); ?>:</b>
	<?php echo CHtml::encode($data->status); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('category_id')); ?>:</b>
	<?php echo CHtml::encode($data->category_id); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('image')); ?>:</b>
	<?php echo CHtml::encode($data->image); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('banner')); ?>:</b>
	<?php echo CHtml::encode($data->banner); ?>
	<br />

	*/ ?>

</div>